package com.dlg.commons.enums;

public enum SystemSourceEnum {
	
	WEB(1, "web"),
	APP(0, "app");
	
	private int code;
	
	private String name;
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	SystemSourceEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}
	
	public static SystemSourceEnum getByCode(int code) {
		SystemSourceEnum[] codes = SystemSourceEnum.values();
		for (SystemSourceEnum state : codes) {
			if (state.getCode() == code) {
				return state;
			}
		}
		return null;
	}
	
	
}
